﻿@model Back_end.Models.Community

@{
	ViewBag.Title = "发布内容";
}

<h2>@ViewBag.Title </h2>


@using (Html.BeginForm())
{
	@Html.AntiForgeryToken()

	<div class="form-horizontal">
		<h4>社区</h4>
		<hr />
		@Html.HiddenFor(model => model.Id)
		@Html.HiddenFor(model => model.PublishedTime)

		@Html.ValidationSummary(true, "", new { @class = "text-danger" })

		<div class="form-group">
			@Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
			<div class="col-md-10">
				@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
				@Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
			</div>
		</div>

		<div class="form-group">
			@Html.LabelFor(model => model.Author, htmlAttributes: new { @class = "control-label col-md-2" })
			<div class="col-md-10">
				@Html.EditorFor(model => model.Author, new { htmlAttributes = new { @class = "form-control" } })
				@Html.ValidationMessageFor(model => model.Author, "", new { @class = "text-danger" })
			</div>
		</div>

		<div class="form-group">
			@Html.LabelFor(model => model.Text, htmlAttributes: new { @class = "control-label col-md-2" })
			<div class="col-md-10">
				@Html.EditorFor(model => model.Text, new { htmlAttributes = new { @class = "form-control" } })
				@Html.ValidationMessageFor(model => model.Text, "", new { @class = "text-danger" })
			</div>
		</div>

		<div class="form-group">
			@Html.LabelFor(model => model.ImgPath, htmlAttributes: new { @class = "control-label col-md-2" })
			<div class="col-md-10">
				<input type="file" data-toggle="modal" data-target="#myModal" id="img">
				@Html.EditorFor(model => model.ImgPath, new { htmlAttributes = new { @class = "form-control" } })
				<input type="button" class="btn btn-primary" id="go" value="确定" />
			</div>
		</div>

		<div class="form-group">
			<div class="col-md-offset-2 col-md-10">
				<input type="submit" value="发布" class="btn btn-default" />
			</div>
		</div>
	</div>
}

<div>
	@Html.ActionLink("返回列表", "Index")
</div>

@section Scripts {
	@Scripts.Render("~/bundles/jqueryval")
	<script src="~/Scripts/localImg.js"></script>
}
